package com.lvmama.pangolin.tc.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.lvmama.pangolin.entity.spider.TicketCommodity;
import com.lvmama.pangolin.entity.tc.TCTicket_CommodityDetail;
import com.lvmama.pangolin.mybatis.mapper.tc.TCTicketCommodityDetailMapper;
import com.lvmama.pangolin.tc.service.TCTicketCommodityDetailService;
@Transactional
@Service
public class TCTicketCommodityDetailServiceImpl implements TCTicketCommodityDetailService{
	/**  
	* @Title：TCTicketCommodityDetailServiceImpl.java
	* @Author:zhoutianqi
	* @Description:
	* @Date：2017年2月17日上午11:19:51  
	*/
	@Autowired
	private TCTicketCommodityDetailMapper tcTicketCommodityDetailMapper;
	@Override
	public List<TCTicket_CommodityDetail> getTCTicket_CommodityDetailListByID(Map<String, Object> map)
			throws Exception {
		return tcTicketCommodityDetailMapper.getTCTicket_CommodityDetailListByID(map);
	}
	public int insertCommodityDetailLog(TCTicket_CommodityDetail detail)throws Exception{
		return tcTicketCommodityDetailMapper.insertCommodityDetailLog(detail);
	};
	/**
	 * 提供分页查询能力
	*/
	public List<TCTicket_CommodityDetail> selectAllLog(int pageNumber,int pageSize)throws Exception{
		List<TCTicket_CommodityDetail> pageInfo = null;
		PageHelper.startPage(pageNumber, pageSize);
		pageInfo = tcTicketCommodityDetailMapper.selectAllLog();
		return pageInfo;
	}
	/**
	 * get a part of commodity data
	 * 1, by taskID
	 * 2, by the startDate and endDate
	*/
	public List<TCTicket_CommodityDetail> queryLogByMap(Map<String,Object> map)throws Exception{
		return tcTicketCommodityDetailMapper.queryLogByMap(map);
	}
	/**
	 * delete a part of commodity data
	 * 1, by taskID
	 * 2, by the startDate and endDate
	*/
	public int deleteLogByMap(Map<String,Object> map)throws Exception{
		return tcTicketCommodityDetailMapper.deleteLogByMap(map);
	}
	public int updateLog(TCTicket_CommodityDetail detail)throws Exception{
		return tcTicketCommodityDetailMapper.updateLog(detail);
	}
	public int deleteLogByID(String detail_id)throws Exception{
		return tcTicketCommodityDetailMapper.deleteLogByID(detail_id);
	}
	@Override
	public List<TCTicket_CommodityDetail> getTCTicket_CommodityDetailLogListByID(Map<String, Object> map) throws Exception {
		// TODO Auto-generated method stub
		return tcTicketCommodityDetailMapper.getTCTicket_CommodityDetailLogListByID(map);
	}
	@Override
	public int insert(TicketCommodity record)
	{
		return tcTicketCommodityDetailMapper.insert(record);
	}
	@Override
	public int insertSelective(TicketCommodity record)
	{
		return tcTicketCommodityDetailMapper.insertSelective(record);
	}
	@Override
	public int deleteByTaskAndProd(TicketCommodity record)
	{
		return tcTicketCommodityDetailMapper.deleteByTaskAndProd(record);
	}

}
